package com.njlime.cms.service.app;

import com.njlime.cms.entities.LiveComment;
import com.njlime.cms.repository.app.AppLiveCommentDao;
import com.njlime.core.base.entities.BaseEntity;
import com.njlime.core.helper.PageBean;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@Service
public class AppLiveCommentService {
    @Resource
    AppLiveCommentDao appLiveCommentDao;

    public Map<String, Object> get(int id) {
        return appLiveCommentDao.get(id);
    }

    /**
     * 保存
     * @param liveComment
     */
    @Transactional(readOnly = false)
    public void save(LiveComment liveComment) {
        appLiveCommentDao.save(liveComment);
    }

    /**
     * 列表
     * @param pageBean
     * @param comment
     * @param uid
     * @return
     */
    public PageBean list(PageBean pageBean, LiveComment comment) {
        return appLiveCommentDao.list(pageBean, comment);
    }

    /**
     * 点赞
     * @param id
     */
    public void fabulousNumUpdate(Integer id, int num){
        appLiveCommentDao.fabulousNumUpdate(id, num);
    }

}
